import time

import testcase


class util:
    def screenshot_error(func):
        def _screenshot_error(self, *args, **kwargs):
            try:
                func(self, *args, **kwargs)
            except Exception as e:
                self.driver.get_screenshot_as_file("error.png")
                raise e
        return _screenshot_error
    def scrolldown(self):
        testcase.testcase.driver.execute_script("window.scrollTo(0,1000)")
        time.sleep(2)